﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using AntiObesity.Base.Managers;

namespace AntiObesity.Services
{
    /// <summary>
    /// Summary description for $codebehindclassname$
    /// </summary>
    [WebService(Namespace = "http://antiobesity-project.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class UsernameExists : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            var name = context.Request["txtUserName"];
            var user = UserManager.FindByName(name);
            context.Response.Write(user == null ? "true" : "false");
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
